#include <iostream>
using namespace std;

// 从二维数组中获取最大值，输出所在位置
int main()
{
  int a[3][4] = {{5, 12, 23, 56}, {19, 28, 37, 56}, {-12, -34, 6, 8}};
  int i, j, row, column, max;
  max = a[0][0];

  for (i = 0; i < 3; i++)
  {
    for (j = 0; j < 4; j++)
    {
      if (a[i][j] > max)
      {
        max = a[i][j];
        row = i;
        column = j;
      }
    }
  }

  cout << "最大值 " << max << "，最大值所在位置为第 " << row + 1 << " 行第 " << column + 1 << " 列" << endl;
}
